<?php print _vivill_render_search_form();?>
<p>
	<?php print t('Hits')?>: <?php print count($data['hits']);?><br/>
</p>
<?php if(count($data['hits']) > 0): ?>
<table>
	<tr>
		<?php foreach($data['stats'] as $party_label => $value): ?>
		<th title="<?php print $data['name_lookup'][$party_label]?>"><?php print $party_label;?></th>
		<?php endforeach; ?>
	</tr>
	<tr>
		<?php foreach($data['stats'] as $party_label => $value): ?>
		<td><?php print $value;?></td>
		<?php endforeach; ?>
	</tr>
</table>

<table id="searchresults" class="tablesorter">
	<thead>
		<tr>
			<th class="header headerSortUp"><?php print t('Year');?></th>
			<th class="header" style="padding-right: 15px;"><?php print t('Party');?></th>
			<th class="header"><?php print t('Title');?></th>
			<th class="header"><?php print t('Type');?></th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($data['hits'] as $h): ?>
		<tr>
			<td><?php print $h['year'];?></td>
			<td title="<?php print $h['name'];?>"><?php print $h['party_label'];?></td>
			<td><img src="/<?php print drupal_get_path('module', 'sndvivill');?>/include/<?php print $h['type'];?>.png" alt="<?php print t($h['type']);?>"><?php print l($h['title'], $h['link']);?></td>
			<td><?php print t($h['type']);?></td>
		</tr>
		<?php endforeach; ?>
	</tbody>
</table>
<?php endif; ?>